<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
</head>
<body>
  <div id="app">
    <input type="text" id="v1" v-model="value1">
    <span>+</span>
    <input type="text" id="v2" v-model="value2">
    <span>=</span>
    <input type="text" id="v3" v-model="value3">
    <input type="button" value="计算" v-on:click="sum"><input type="button" value="清空">
  </div>
  <script type="text/javascript">
    //element
    let vm = new Vue({
        el:"#app",
        data:{
            value1:0,
            value2:0,
            value3:0
        
        },
        methods:{
            sum:function (){
                this.value3 = parseInt(this.value1) + parseInt(this.value2);
            }
        }
    });
  </script>  
</body>
</html>